package com.summer.bilibili.dto;

import com.summer.bilibili.domain.enums.CommentFlag;
import com.summer.bilibili.validator.group.Create;
import com.summer.bilibili.validator.group.Update;
import lombok.Data;
import org.hibernate.validator.constraints.Range;


import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

import static com.summer.bilibili.consts.Consts.USER_MAX_LEVEL;
import static com.summer.bilibili.consts.Consts.USER_MIN_LEVEL;


@Data
public class CommentAreaDto implements Serializable {
    @NotNull(groups = Update.class)
    @Null(groups = Create.class)
    private Long id;

    @NotNull(groups = Create.class)
    private CommentFlag commentFlag;

    @NotNull(groups = Create.class)
    @Range(min = USER_MIN_LEVEL, max = USER_MAX_LEVEL)
    private Integer userLevel;
}
